#ifndef ZADACHA_H
#define ZADACHA_H

#include <vector>
#include <valarray>
#include <string>

class input {
    public:
    void init(std::string file);
    unsigned m;
    unsigned q;
    std::valarray<double> x;
    std::valarray<double> xl;
    std::valarray<double> xu;
    std::valarray<double> xlf;
    std::valarray<double> xuf;

    std::valarray<double> ind_xl;
    std::valarray<double> ind_xu;
    std::valarray<double> ind_xlf;
    std::valarray<double> ind_xuf;

    double t, tf;
    unsigned N;
    double beta0;
    std::vector<double> beta1, beta2;
    std::vector<double> df;
    unsigned num_upr;
    std::vector<double> rgn;
    std::valarray<double> c;
    double eps;
    double epsilon;
    double F;
    std::vector<std::vector<double> > tau;

    //    std::valarray<double> tau0;
    //    std::valarray<double> rgn_tau;
    unsigned sum_c;
    unsigned n, num;
    unsigned tip_metoda, tip_integr;
    unsigned tip, integr;
    std::vector<std::string> functions;
    std::string parsx;
    std::string pars;
    double step0, step1;
    unsigned s;
    std::vector<unsigned> sum;
    void set_method(unsigned a, unsigned b);

};

std::valarray<double> right_parts(std::valarray<double> x, double t, std::valarray<double> u, input& data);  //правые части системы
double I(std::valarray<double> x, input& data);                                                              //оштрафованный функционал
double F0(std::valarray<double> x, input& data);                                                             //терминальный функционал
std::valarray<double> delta(std::valarray<double> x, input& data);
std::valarray<double> delta_f(std::valarray<double> x, input& data);

#endif /*ZADACHA_H*/
